% xcolor and define colors -------------------------
\usepackage{xcolor}

% https://www.materialpalette.com/colors
\definecolor{red}{HTML}{c62828}
\definecolor{orange}{HTML}{ef6c00}
\definecolor{green}{HTML}{2e7d32}
\definecolor{blue}{HTML}{1565c0}
\definecolor{purple}{HTML}{283593}
\definecolor{maroon}{HTML}{AF3335}
\definecolor{dark-maroon}{HTML}{5D0F0D}
\definecolor{teal}{HTML}{00695c}
\definecolor{bluegrey}{HTML}{455a64}
\definecolor{indigo}{HTML}{1A237E}
\definecolor{navyblue}{HTML}{0A3044}
\definecolor{bluegreen}{HTML}{4A8676}

\definecolor{Black}{HTML}{000000}
\definecolor{White}{HTML}{FFFFFF}
\definecolor{accent}{HTML}{93869a}

% CU Boulder colors ---------------------------------
\definecolor{buff-gold}{HTML}{CFB87C}
\definecolor{buff-grey}{HTML}{565A5C}
\definecolor{buff-lightgrey}{HTML}{A2A4A3}
\definecolor{buff-black}{HTML}{000000}

% Beamer Options -------------------------------------

% Background
\definecolor{mybackground}{HTML}{ECECEC}
\setbeamercolor{background canvas}{bg= mybackground}

% Block
\metroset{block=fill}

% Custom Colors --------------------------------------
% \alert
\setbeamercolor{alerted text}{fg = accent}

% Frame title
\setbeamercolor{frametitle}{bg = Black}
\setbeamercolor{title}{fg = Black}
\setbeamercolor{subtitle}{fg = accent}

% Table of Contents
\setbeamercolor{section in toc}{fg = Black}
\setbeamercolor{subsection in toc}{fg = Black}

% Button 
\setbeamercolor{button}{bg = accent}



% CU Colors ------------------------------------------
% \alert
% \setbeamercolor{alerted text}{fg= buff-gold!80!black}
% \setbeamercolor{alerted text}{fg= buff-gold!80!black}

% Frame title
% \setbeamercolor{frametitle}{bg= buff-black}
% \setbeamercolor{title}{fg= buff-grey}

% Button 
% \setbeamercolor{button}{bg= buff-gold}



% Enumitem ------------------------------------------
\usepackage{enumitem}
\setitemize{labelindent=0.5em,labelsep=0.25cm,leftmargin=*}
\setenumerate{labelindent=0.5em,labelsep=0.25cm,leftmargin=*}


% \begin{columns} -----------------------------------
\usepackage{multicol}


% Fonts ---------------------------------------------
% Beamer Option to use custom fonts
\usefonttheme{professionalfonts}

\usepackage[utopia, smallerops, varg]{newtxmath}
\usepackage{utopia}

% Small adjustments to text kerning
\usepackage{microtype}



% Remove annoying over-full box warnings -----------
\vfuzz2pt 
\hfuzz2pt


% Table of Contents with Sections
\setbeamerfont{myTOC}{series=\bfseries, size=\Large}
\AtBeginSection[]{
        \frame{
            \frametitle{Outline}
            \usebeamerfont{myTOC}
            \tableofcontents[current]
        }
    }


% References ----------------------------------------
\usepackage[
    citestyle= authoryear,
    style= authoryear, 
    natbib= true, 
    backend= biber
]{biblatex}

% Remove bibliography symbol in slides
\setbeamertemplate{bibliography item}{}

% Smaller font-size for references
\renewcommand*{\bibfont}{\small}

% Color citations for slides
\newenvironment{citecolor}
    {\footnotesize\begin{color}{accent}}
    {\end{color}}

\newcommand{\citetcolor}[1]{\footnotesize\textcolor{accent}{\citet{#1}}}
\newcommand{\citepcolor}[1]{\footnotesize\textcolor{accent}{\citep{#1}}}


% Tables -------------------------------------------
% Tables too big
% \begin{adjustbox}{width = 1.2\textwidth, center}
\usepackage{adjustbox}
\usepackage{array}
    
% Tables too narrow
% \begin{tabularx}{\linewidth}{cols}
% col-types: X - center, L - left, R -right
% Relative scale: >{\hsize=.8\hsize}X/L/R
\usepackage{tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}


% \imageframe{img_name} -----------------------------
% from https://github.com/mattblackwell/cousteau
\newcommand{\imageframe}[1]{%
    \begin{frame}[plain]
        \begin{tikzpicture}[remember picture, overlay]
            \node[at = (current page.center), xshift = 0cm] (cover) {%
                \includegraphics[keepaspectratio, width=\paperwidth, height=\paperheight]{#1}
            };
        \end{tikzpicture}
    \end{frame}%
}


% Table Highlighting --------------------------------
% Create top-left and bottom-right markets in tabular cells with a unique matching id and these commands will outline those cells
\usepackage[beamer,customcolors]{hf-tikz}
\usetikzlibrary{calc}
\usetikzlibrary{fit,shapes.misc}

% To set the hypothesis highlighting boxes red.
\tikzset{hl/.style={
    set fill color=red!80!black!40,
    set border color=red!80!black,
  },
}
\newcommand\marktopleft[1]{%
    \tikz[overlay,remember picture] 
        \node (marker-#1-a) at (0,1.5ex) {};%
}
\newcommand\markbottomright[1]{%
    \tikz[overlay,remember picture] 
        \node (marker-#1-b) at (0,0) {};%
    \tikz[red, ultra thick, overlay, remember picture, inner sep=4pt]
        \node[draw, rectangle, fit=(marker-#1-a.center) (marker-#1-b.center)] {};%
}


